<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p id="talkMsg"></p>
<input type="text" id="msg"> <button onclick="sendMsg()">发送</button>

<img src="https://back-tones.oss-cn-beijing.aliyuncs.com/bae6f0a3-6e4e-477a-af7b-d30d94d4c354.png">


<a>aaaaaaaaaaaaa</a>
<embed src="https://back-tones.oss-cn-beijing.aliyuncs.com/2024-07-30-11-03-384874530e-057d-4ec7-bff1-3583bf71ae47.pdf" width="500" height="600">

</body>

<script>

    let webSocket = new WebSocket("ws://localhost:8080/myWs1");
    webSocket.onopen=function () {
        webSocket.send("建立连接了")
    }
    webSocket.onmessage=function (msg) {
        document.getElementById("talkMsg").innerHTML = msg.data
    }
    webSocket.onclose=function () {
        webSocket.send("我断开连接了")
    }
    function sendMsg() {
        webSocket.send(document.getElementById("msg").value)
        document.getElementById("msg").value =""
    }


</script>
</html>
